#!/bin/bash
TEST_NAME=$1
JAR_NAME='UiTest.jar'
File_Path='/Users/mingwei/code/git100tal/xesappchannel/UiAutomator/bin'

adb push $File_Path/$JAR_NAME /data/local/tmp/

if [ -z "$TEST_NAME" ]; then
  sleep 5
  adb shell uiautomator runtest $JAR_NAME -c com.xesapp.uiautomator.UiautomatorMain
else
  sleep 5
  # shellcheck disable=SC2086
  adb shell uiautomator runtest $JAR_NAME -c com.xesapp.uiautomator.$TEST_NAME
fi